package com.jzo2o.customer.controller.worker;

import com.jzo2o.common.model.Result;
import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/worker/bank-account")
@Slf4j
@Api(tags = "服务端 - 银行卡相关接口")
public class BankAccountController {
    private final IBankAccountService bankAccountService;

    @PostMapping
    @ApiOperation("添加银行卡")
    public void addBankAccount(@RequestBody BankAccountUpsertReqDTO dto) {

        bankAccountService.addBankAccount(dto);
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行卡信息")
    public BankAccountResDTO currentUserBankAccount() {
        return bankAccountService.currentUserBankAccount();
    }
}
